<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/com/include/declare.jspf" %>
<%@ include file="/WEB-INF/jsp/com/include/doctype.jspf" %>
<script type="text/javascript" src="<c:url value='/common/js/ajaxupload.js'/>"></script>

<%@ include file="/WEB-INF/jsp/com/include/session.jspf" %>
<%@ include file="/WEB-INF/jsp/com/include/navi_utill_sub.jspf" %>
<%@ include file="/WEB-INF/jsp/com/include/navi_header.jspf" %>


<script type = "text/javascript" language = "javascript">

document.domain="hyundai.com" ;

$(document).ready(function() {

    
    //해당시도의  시/군구를 조회한다.
    
    searchAdmz();
   
});



function fnSearchWpaList()
{

    $.post("<c:url value='/pur/selectWpaList.do'/>",
            {
                
            },
            function(data){
                var WpaList=[];
                var items = $(data).find("item");
                var ite = items.size();
           
                items.each(function(index,element){
                   var object={};
                   var wpaCd = $(this).find("value").eq(0).text();
                   var wpaNm = $(this).find("value").eq(1).text();
                   object["code"] = wpaCd;
                   object["name"] = wpaNm;

                   WpaList[index] = object;
                });
               
                if(WpaList.length > 0){

                    $('#WpaCode').find("option").remove();
                    $('#WpaCode').append('<option value="" >광역시/도</option>');

                    for(var i=0; i<WpaList.length; i++){

                        $('#WpaCode').append('<option value="'+WpaList[i]["code"]+'">'+WpaList[i]["name"]+'</option>');
                        }
                }
                else{

                    $('#WpaCode').find("option").remove();
                    $('#WpaCode').append('<option value="">광역시/도</option>');
                }

            }
        );    

}




function searchAdmz(){
    var wpaNm1 = document.getElementById("selWpaNm");
    var purScn = document.getElementById("purScn");

    //초기화면에서는 Relaod하면 안된다.
    if(purScn == "") return;


    //시,군,구를 조회해 온다.
    $.post("<c:url value='/pur/selectAdmzList.do'/>",
            {
                'wpaNm' : wpaNm1.value   
            },
            function(data){
                var AdmzList=[];
                var items = $(data).find("item");
                var ite = items.size();
                items.each(function(index,element){
                   var object={};
                   var wpaNm1 = $(this).find("value").eq(0).text();

                   object["name"] = wpaNm1;

                   AdmzList[index] = object;
                });
                
                var inHTML = "";
               
                inHTML = inHTML + '<select class="select select-type2" style="width:200px;"  id="brDtlAdr2" name="brDtlAdr2">';
                inHTML = inHTML + '<option value="">시/군/구</option>';

                if(AdmzList.length > 0){

                    var admz = "" ;
                    var voadmz = "${ purMgmtSearchVO.brDtlAdr2}";
           

                    var selt = "";
                   for(var i=0; i<AdmzList.length; i++){
                       admz = AdmzList[i]["name"];
                       if(voadmz == admz){
                          selt = "selected";
                       }else{ 
                           selt = ""; 
                       }
                       inHTML = inHTML + '<option value="'+admz+'"' +selt + '>'+ admz + '</option>';
                  } 
                } 
                inHTML = inHTML + '</select>';
          
                   $('#brDtlAdr12').html('');  
                   $('#brDtlAdr12').html(inHTML);
                   $('#brDtlAdr2').customSelect();
                
               
            }    
            
        );    
   

   
}

function fnLinkPage(pageIndex) {
    $("#pageIndex").val(pageIndex);
    
    var form = document.PurCounselReqForm;
    
    form.action = "<c:url value='/pur/purCounselReqPaging.do'/>";
    form.submit();
}

/* 지역의 지점을 조회한다*/
function brAgentSearch(){
    
    
  
   var purScn = document.getElementById("purScn");
   purScn.value = "2";

     
   var wpaNm = document.getElementById("wpaNm");
   var wpaNm1 = document.getElementById("selWpaNm");
   wpaNm.value=wpaNm1.value;
  

       
   var brCheck = document.getElementById("brCheck");
   var agntCheck = document.getElementById("agntCheck");
   var brCheckFlg = document.getElementById("brCheckFlg");
   var agntCheckFlg = document.getElementById("agntCheckFlg");
   
   if(brCheck.checked == true) brCheckFlg.value = "Y";
   else brCheckFlg.value = "N";
   if(agntCheck.checked == true ) agntCheckFlg.value = "Y";
   else agntCheckFlg.value="N";

   if(wpaNm.value ==""){
       alert("시/도를 선택하세요");
       wpaNm.focus();
       return ;
   }
   if((brCheckFlg.value == "N") && (agntCheckFlg.value== "N")){
       alert("지점 또는 대리점을 선택하세요");
       return ;
   }
  
   fnLinkPage(1);
   var form = document.PurCounselReqForm;
   form.action = "<c:url value='/pur/purCounselReqPaging.do'/>";
   form.submit();   

}

function brChk(){
    var brCheck = document.getElementById("brCheck");
    var allCheck = document.getElementById("allCheck");

    if(brCheck.checked == false) allCheck.checked = false;

}

function agntChk(){
    var agntCheck = document.getElementById("agntCheck");
    var allCheck = document.getElementById("allCheck");

    if(agntCheck.checked == false) allCheck.checked = false;

}

function allChecked(){

    var allCheck = document.getElementById("allCheck");
    var brCheck = document.getElementById("brCheck");
    var agntCheck = document.getElementById("agntCheck");
    
    if(allCheck.checked == true){
        brCheck.checked = true;
        agntCheck.checked = true;
    }else{
        brCheck.checked = false;
        agntCheck.checked = false;
    }
    
    
}


function reqConfirm(){

    var reqFlg = document.getElementById("reqFlg");

    $.post("<c:url value='/pur/purReqReg2week.do'/>",
            {
                'reqMbrSn' : ${userInfo.mbrSn}
            },
            function(data){
           
                var result={};
                var items = $(data).find("item");
                items.each(function(index,element){
                   var name = $(this).find("name").text();
                   var value = $(this).find("value").text();
                   result[name] = value;  
        
                });

                if(result["result"] =="OK"){
                    reqConfirm2();
                } else if (result["result"] == "DOBNON") {
                    regdtm.innerHTML="<br/>현재 고객님은  <B>2주내</B> 구매상담신청 서비스를 신청하셨습니다. <br /><br />고객님은  <B>" + result["sRgstDtm"] + "</B> 부터 재신청이 가능합니다. ";
                    fnInsertPopup('#counselpurchaWeekNonCheck');
                }
        
            }
        );
        
}

function reqConfirm2(){

    var reqFlg = document.getElementById("reqFlg");

    if(reqFlg.value== "1"){
        carMstSet1();
        fnInsertPopup('#carmastersearch');  
        dcsMultiTrack('DCS.dcssip','www.hyundai.com','DCS.dcsurl','/pur/purCounselReqPaging.do','WT.ti','홈_상담_구매상담신청','WT.si_n','Hyundai_Consultation','WT.si_x','1');
    }
    else if (reqFlg.value == "2"){
        brOrCmstStdCarInfo(); 
        fnInsertPopup('#counselpurchase'); 
        dcsMultiTrack('DCS.dcssip','www.hyundai.com','DCS.dcsurl','/pur/purCounselReqPaging.do','WT.ti','홈_상담_구매상담신청','WT.si_n','Hyundai_Consultation','WT.si_x','1');
    }else{
        alert("카마스터 또는 지점을 선택하여 주십시요");
        return;; 
    }
        
}


function  brOrCmstStdCarInfo(){
 
    var callFlg = document.getElementById("callFlg");
    var cmstNo   = document.getElementById("cMstNo");
    var brCd =  document.getElementById("brCd");
    
    var wpaNm = document.getElementById("wpaNm");
    var admzNm = document.getElementById("admzNm");

    var brInfoDiv = document.getElementById("brInfoDiv");
    var CmstInfoDiv = document.getElementById("CmstInfoDiv");
        
    var carGrdSel = document.getElementById("carGrdSel");
    var carGrdDtlSel = document.getElementById("carGrdDtlSel");
    var carColorSel =  document.getElementById("carColorSel");
    
    carGrdSel.value = "";
     carGrdDtlSel.value="";
     
    carColorSel.value = "";
    if(callFlg.value == "1"){
        CmstInfoDiv.style.display = "block";
        brInfoDiv.style.display="none";
    }else{
        CmstInfoDiv.style.display = "none";
        brInfoDiv.style.display="block";
    }
    if(callFlg.value == "2"){ //담당 카마스터 조회(고객정보 Update와 같이 한다)
     //담당지점조회(고객정보 Update와 같이 한다)
          $.post("<c:url value='/pur/selectBrInfo.do'/>",
                  {
                  'brCd' : brCd.value
                  },
                  function(data){
                  var BrInfoList = [];
                  var items = $(data).find("item");
                  var ite = items.size();
                  items.each(function(index,element){
                      var object ={};
                      var ctrCd = $(this).find("value").eq(0).text();
                      object["ctrCd"] = ctrCd;
                      var brCd = $(this).find("value").eq(1).text();
                      object["brCd"] = brCd;
                      var brNm = $(this).find("value").eq(2).text();
                      object["brNm"] = brNm;
                      var brCcpc = $(this).find("value").eq(3).text();
                      object["brCcpc"] = brCcpc;
                      var brScn = $(this).find("value").eq(4).text();
                      object["brScn"] = brScn;
                      BrInfoList[index] = object;
                  });
                  
                 var reqCtrCd = document.getElementById("reqCtrCd");
                 var reqBrCd = document.getElementById("reqBrCd");
                 var reqBrNm  = document.getElementById("reqBrNm");
                 var reqBrCcpc =document.getElementById("reqBrCcpc");
                 var reqBrScn  = document.getElementById("reqBrScn");
                 

                  reqCtrCd.value = BrInfoList[0]["ctrCd"];
                  reqBrCd.value = BrInfoList[0]["brCd"];
                  reqBrNm.innerHTML   = BrInfoList[0]["brNm"];
                  reqBrCcpc.innerHTML = BrInfoList[0]["brCcpc"];
                  
                  reqBrScn.value = BrInfoList[0]["brScn"];
                     
                      
                  }
              );  
      }
  
  //차랑 정보를 조회한다
  
  $.post("<c:url value='/pur/carCodeInfo.do'/>",
          {
          },
          function(data){
              var CarInfoList = [];
              var items = $(data).find("item");
              var ite = items.size();
              
              items.each(function(index,element){
                  var object ={};
                  var carCd = $(this).find("value").eq(0).text();
                  object["carCd"] = carCd;
                  var carNm = $(this).find("value").eq(1).text();
                  object["carNm"] = carNm;
                  var vehlImgNm = $(this).find("value").eq(2).text();
                  object["vehlImgNm"] = vehlImgNm;
                  var vehlImgSn = $(this).find("value").eq(3).text();
                  object["vehlImgSn"] = vehlImgSn;
                  CarInfoList[index] = object;
              });
          
            
              
              if(CarInfoList.length > 0){
                  var iRtn = 0 ;
                  var inHTML = "";
                  var iMod = 0;
                  
                  
                  for(var i=1; i <= CarInfoList.length; i++){
                     if(iRtn ==0) {
                         inHTML = inHTML + "<div class='section' >";
                         iRtn = 1;
                     }
                     inHTML = inHTML + "<div id='carImgArea' >";
                     
                     inHTML = inHTML + "<img src='/kr/file/imagePathView.do?nrFilNm=trcarimage/" + CarInfoList[i-1]["vehlImgNm"] + "' alt='" + CarInfoList[i-1]["carNm"]+ "' onClick=\"carSelect('" + CarInfoList[i-1]["carCd"] + "','" + CarInfoList[i-1]["vehlImgNm"] + "')\" width='90' height ='55'>";
                     inHTML = inHTML + "<p class='name'>" + CarInfoList[i-1]["carNm"] + "</p>";
                     inHTML = inHTML + "</div>";
                     
                     if((i % 7) == 0){
                         iRtn = 0;
                         inHTML = inHTML + "</div>";
                     }
                     if((i == CarInfoList.length ) && (iRtn != 0)) iRtn == 0;
                     
                   }
                  
                  if(iRtn == 0){
                      inHTML = inHTML + "</div>";
                  }
                  inHTML = inHTML + "</div>";

                  document.getElementById("carInfoDiv").innerHTML = inHTML ;
                 
             }
 
          }
      );      

      
      
    
    
}

function htmlCSSReplace(str){
    str = str.replaceAll("<","&lt;");//HTML tag를 모두 제거
    str = str.replaceAll(">","&gt;");
    str = str.replaceAll("&lt;p&gt;", "<p>");
    str = str.replaceAll("&lt;P&gt;", "<P>");
    str = str.replaceAll("&lt;br&gt;", "<br>");
    str = str.replaceAll("&lt;BR&gt;", "<BR>");
    
    return str;
}


function htmlCSSUnReplace(str){
    str = str.replaceAll("&lt;","<");//HTML tag를 모두 제거
    str = str.replaceAll("&gt;",">");
    str = str.replaceAll("<p>" ,"&lt;p&gt;" );
    str = str.replaceAll("<P>" ,"&lt;P&gt;" );
    str = str.replaceAll("<br>","&lt;br&gt;");
    str = str.replaceAll("<BR>","&lt;BR&gt;");
    return str;
}


function counsel_purchase_popup_req(){
    
    var mobileCom = document.getElementById("mobileCom");
    var hpNo2 = document.getElementById("hpNo2");
    var hpNo3 = document.getElementById("hpNo3");
    var hpNo = mobileCom.value + "-" + hpNo2.value  + "-"+ hpNo3.value ;
    
    var tymdYYYY = document.getElementById("tymdYYYY");

    var tymdMM   = document.getElementById("tymdMM");
    var tymdDD   = document.getElementById("tymdDD");
  
  
    var tymd = tymdYYYY.value + tymdMM.value + tymdDD.value;
    
    var mbrSex = document.getElementById("mbrSex");
    
    var zipScn =  document.getElementById("zipScn");  
    var zipSn01 = document.getElementById("zipSn01");
    var zipSn02 = document.getElementById("zipSn02");
    
    var zipSn = zipSn01.value  + zipSn02.value;
    
    var adr = document.getElementById("adr");

    var dtlAdr = document.getElementById("dtlAdr");
    
    var callFlg = document.getElementById("callFlg");
    var cMstNo   = document.getElementById("cMstNo");
    var brCd =  document.getElementById("brCd");
    
    var wpaNm = document.getElementById("wpaNm");
    var admzNm = document.getElementById("admzNm");

    var brInfoDiv = document.getElementById("brInfoDiv");
    var CmstInfoDiv = document.getElementById("CmstInfoDiv");
        
    var carGrdSel = document.getElementById("carGrdSel");


    if(callFlg.value == "1"){ //담당 카마스터 조회(고객정보 Update와 같이 한다)
      //담당 카마스터 조회에서 이미 자료가 Setting되어 진다
    $.post("<c:url value='/pur/selectCmstInfo.do'/>",
            {
            'mbrSn': ${userInfo.mbrSn},
            'hpNo' : hpNo,
            'tymd' : tymd,
            'mbrSex' : mbrSex.value,
            'zipScn' : zipScn.value,
            'zipSn01': zipSn01.value,
            'zipSn02': zipSn02.value,
            'adr'    : adr.value,
            'dtlAdr' : dtlAdr.value,
            'cMstNo' : cMstNo.value,
            'schCon' : callFlg.value,
            'brCd'   :brCd.value
            },
            function(data){

            }
        );     
    }else{ //담당지점조회(고객정보 Update와 같이 한다)
        $.post("<c:url value='/pur/selectBrInfo1.do'/>",
                {
                'mbrSn': ${userInfo.mbrSn},
                'hpNo' : hpNo,
                'tymd' : tymd,
                'mbrSex' : mbrSex.value,
                'zipScn' : zipScn.value,
                'zipSn01': zipSn01.value,
                'zipSn02': zipSn02.value,
                'adr'    : adr.value,
                'dtlAdr' : dtlAdr.value,
                'brCd' : brCd.value
                },
                function(data){
                    
                }
            );  
    }
    
    //지점코드
    var reqCtrCd = document.getElementById("reqCtrCd");
    var reqBrCd = document.getElementById("reqBrCd");
    var reqCmEeno = document.getElementById("reqCmEeno");
    var reqCarCd = document.getElementById("reqCarCd");
    var reqCarGrdCd = document.getElementById("carGrdSel");
    var reqCarGrdDtlCd = document.getElementById("carGrdDtlSel");
    var reqCarColorCd = document.getElementById("carColorSel");
    var callFlg = document.getElementById("callFlg");    
   
    $.post("<c:url value='/pur/purReqReg.do'/>",
            {
                'reqCtrCd': reqCtrCd.value,
                'reqBrCd': reqBrCd.value,
                'reqCmEeno': reqCmEeno.value,
                'reqCarCd': reqCarCd.value,
                'reqCarGrdCd': reqCarGrdCd.value,
                'reqCarGrdDtlCd':reqCarGrdDtlCd.value,
                'reqCarColorCd':reqCarColorCd.value,
                'reqMbrSn' : ${userInfo.mbrSn},
                'reqScnCd' : callFlg.value
            },
            function(data){
           
                var result={};
                var items = $(data).find("item");
                items.each(function(index,element){
                   var name = $(this).find("name").text();
                   var value = $(this).find("value").text();
                   result[name] = value;  

                });
   
            }
        );          
        
    dcsMultiTrack('DCS.dcssip','www.hyundai.com','DCS.dcsurl','/pur/purCounselReqPaging.do','WT.ti','홈_상담_구매상담신청_완료','WT.si_n','Hyundai_Consultation','WT.si_x','2','WT.si_cs','1','WT.pn_sku',reqCarCd.value,'WT.tx_u','1');

    //초기화 한다  
    reqCtrCd.value = "" ;
    reqBrCd.value = "";
    reqCmEeno.value = "";
    reqCarCd.value = "";
    reqCarGrdCd.value = "";
    reqCarGrdDtlCd.value = "";
    reqCarColorCd.value ="";
    callFlg.value = "";
    
    
    closeLayer('#personinfopopup-catalog2');     


        fnInsertPopup('#counselpurchasecheck');
    
    
}    
    
function carSelect(carCd,imgPath){
 
    //차랑 정보를 조회한다
    
    $.post("<c:url value='/pur/carCodeInfo.do'/>",
            {
            },
            function(data){
                var CarInfoList = [];
                var items = $(data).find("item");
                var ite = items.size();
                
                items.each(function(index,element){
                    var object ={};
                    var carCd = $(this).find("value").eq(0).text();
                    object["carCd"] = carCd;
                    var carNm = $(this).find("value").eq(1).text();
                    object["carNm"] = carNm;
                    var vehlImgNm = $(this).find("value").eq(2).text();
                    object["vehlImgNm"] = vehlImgNm;
                    var vehlImgSn = $(this).find("value").eq(3).text();
                    object["vehlImgSn"] = vehlImgSn;
                    CarInfoList[index] = object;
                });
            
                document.getElementById("carInfoDiv").innerHTML = "";
               
                if(CarInfoList.length > 0){
                    var iRtn = 0 ;
                    var inHTML = "";
                    var iMod = 0;
                    
                    
                    for(var i=1; i <= CarInfoList.length; i++){
                       if(iRtn ==0) {
                           inHTML = inHTML + "<div class='section' >";
                           iRtn = 1;
                       }
                  
      
                       if(CarInfoList[i-1]["carCd"] == carCd){
                       inHTML = inHTML + "<div id='carImgArea' class='on'>";
                       }else{
                           inHTML = inHTML + "<div id='carImgArea' >";
                       }
                           
                       inHTML = inHTML + "<img src='/kr/file/imagePathView.do?nrFilNm=trcarimage/" + CarInfoList[i-1]["vehlImgNm"] + "' alt='" + CarInfoList[i-1]["carNm"]+ "' onClick=\"carSelect('" + CarInfoList[i-1]["carCd"] + "','" + CarInfoList[i-1]["vehlImgNm"] + "')\" width='90' height ='55'>";
                       inHTML = inHTML + "<p class='name'>" + CarInfoList[i-1]["carNm"] + "</p>";
                       inHTML = inHTML + "</div>";
                       
                       if((i % 7) == 0){
                           iRtn = 0;
                           inHTML = inHTML + "</div>";
                       }
                       if((i == CarInfoList.length ) && (iRtn != 0)) iRtn == 0;
                       
                     }
                    
                    if(iRtn == 0){
                        inHTML = inHTML + "</div>";
                    }
                    inHTML = inHTML + "</div>";

                    document.getElementById("carInfoDiv").innerHTML = inHTML ;
                   
               }
         
            }
        );      
    
    
    var reqCarCd = document.getElementById("reqCarCd");
    
    reqCarCd.value = carCd ;
    
    //차량 등급을 조회한다.
    
    $.post("<c:url value='/pur/carGradeList.do'/>",
            {'carCd': carCd
            },
            function(data){
                var CarGrdeInfoList = [];
                var items = $(data).find("item");
                var ite = items.size();
                
                items.each(function(index,element){
                    var object ={};
                    var carCd = $(this).find("value").eq(0).text();
                    object["carCd"] = carCd;
                    
                    var grdCd = $(this).find("value").eq(1).text();
                    object["grdCd"] = grdCd;
                    
                    var grdNm = $(this).find("value").eq(2).text();
                    object["grdNm"] = grdNm;
                    CarGrdeInfoList[index] = object;
                });
            
                
                var inHTML = "";
                
                inHTML = inHTML + '<select  class="select select-type2" style="width:240px;" id="carGrdSel" name="carGrdSel" onChange="carGrdDtlSearch()">';
                inHTML = inHTML + '<option value="">등급선택</option>';
                
                if(CarGrdeInfoList.length > 0){


                    for(var i=0; i<CarGrdeInfoList.length; i++){
                        inHTML = inHTML + '<option value="'+CarGrdeInfoList[i]["grdCd"]+'" >'+CarGrdeInfoList[i]["grdNm"]+'</option>';

                    }
                 }


                inHTML = inHTML + '</select>';
               

                $('#spCarGrdSel').html('');  
                $('#spCarGrdSel').html(inHTML);
                ;
                $('#carGrdSel').customSelect();
                                
                
                
            }
        );          
    
     //차량 컬러를 조회한다.    
    
    $.post("<c:url value='/pur/carColorList.do'/>",
            {'carCd': carCd
            },
            function(data){
                var CarColorInfoList = [];
                var items = $(data).find("item");
                var ite = items.size();
                
                items.each(function(index,element){
                    var object ={};
                    var colorCd = $(this).find("value").eq(0).text();
                    object["colorCd"] = colorCd;
                    var colorNm = $(this).find("value").eq(1).text();
                    object["colorNm"] = colorNm;
                    CarColorInfoList[index] = object;
                });
            
                var inHTML = "";
                
                inHTML = inHTML + '<select class="select select-type2" style="width:240px;" id="carColorSel" name="carColorSel">';
                inHTML = inHTML + '<option value="">컬러선택</option>';
                
                
                if(CarColorInfoList.length > 0){


                    for(var i=0; i<CarColorInfoList.length; i++){
                        

                        inHTML = inHTML + '<option value="'+CarColorInfoList[i]["colorCd"]+'">'+ CarColorInfoList[i]["colorNm"] + '</option>';
                    }
                 }
                inHTML = inHTML + '</select>';
                $('#spCarColorSel').html('');  
                $('#spCarColorSel').html(inHTML);
                $('#carColorSel').customSelect();
   
            }
        );          
    
  
}

function carGrdDtlSearch(){
 
    var grdCd = document.getElementById("carGrdSel");
  
    //차량 상세등급을 조회한다.
    if(grdCd.value == "") return ;
    
    $.post("<c:url value='/pur/carGradeDtlList.do'/>",
            {'grdCd': grdCd.value
            },
            function(data){
                var CarGrdDtlInfoList = [];
                var items = $(data).find("item");
                var ite = items.size();
                
                items.each(function(index,element){
                    var object ={};
                    var grdCd = $(this).find("value").eq(0).text();
                    object["grdCd"] = grdCd;
                    var trimCd = $(this).find("value").eq(1).text();
                    object["trimCd"] = trimCd;
                    var trimNm = $(this).find("value").eq(2).text();
                    object["trimNm"] = trimNm;
                    CarGrdDtlInfoList[index] = object;
                });
            
                var inHTML = "";
                
                inHTML = inHTML + '<select  class="select select-type2" style="width:240px;" id="carGrdDtlSel" name="carGrdDtlSel">';
                inHTML = inHTML + '<option value="">상세등급선택</option>';
                
                
                if(CarGrdDtlInfoList.length > 0){

                    for(var i=0; i<CarGrdDtlInfoList.length; i++){
                        
                        inHTML = inHTML + '<option value="'+CarGrdDtlInfoList[i]["trimCd"]+'"  >'+CarGrdDtlInfoList[i]["trimNm"]+'</option>';


                    }
                 }

                inHTML = inHTML + '</select>';
                $('#spCarGrdDtlSel').html('');  
                $('#spCarGrdDtlSel').html(inHTML);
                $('#carGrdDtlSel').customSelect();
  
            }
        );          
    

    
}







function zipCodePopUp(obj) {

newWindow =  window.open("/kr/mbr/zipCodePopUp.do","우편번호찾기","top=500px,left=800px,height=800px,width=660px,scrollbars=yes,menubar=no,toolbar=no,status=no");


}

function mbrInfoUpdate(){

    var agrChk = document.getElementById("agrChk");
    var perAgrChk = document.getElementById("perAgrChk");
    var mktAgrChk = document.getElementById("mktAgrChk");
   
    if(perAgrChk.checked != true){
        alert("개인정보 수집및 이용 목적에  동의하여 주십시요");
        perAgrChk.focus();
        return;
    }

    if(mktAgrChk.checked != true){
        alert("마케팅 활용에  동의하여 주십시요");
        mktAgrChk.focus();
        return;
    }
    
    if(agrChk.checked != true){
        alert("개인정보 보유 및 이용기간에  동의하여 주십시요");
        agrChk.focus();
        return;
    }
    

    counsel_purchase_popup_req();
}

//카마스터 선택
//카 마스터를 선택하면 카 마스터 조회화면이 먼저 호출되고 
//그다음 상담 신청화면을 호출한다.
function carMstSet(brCd1){
    
    var callFlg = document.getElementById("callFlg");
    callFlg.value = "1";   
    var brCd =  document.getElementById("brCd");
    brCd.value = brCd1;
    var reqFlg = document.getElementById("reqFlg");
    reqFlg.value= "1"; //1 - 카마스터 상담  2-지점상담   
    //alet(brCd.value);
    var chgMasterFlg = document.getElementById("chgMasterFlg");
    chgMasterFlg.value = "";    
    //이전 마스터조회내용을 삭제처리한다.
    
}

function carMstSet1(){
    var callFlg = document.getElementById("callFlg");
    var brCd =  document.getElementById("brCd");
    var reqFlg = document.getElementById("reqFlg");
    //카마스터 변경 flg를 초기화 한다
    var chgMasterFlg = document.getElementById("chgMasterFlg");
    chgMasterFlg.value = "";
  // var curPage = document.getElementById("curPage");
    
    reqFlg.value= "1"; //1 - 카마스터 상담  2-지점상담
    //callFlg.value = "1";
   // brCd.value = brCd1;
    //해당 지점의 카마스터를 조회하여 Display한다.
    
 
    
    var selSearchCon1 = '4';
    var conName1 = brCd.value;
    var curPage1 = '1';
    
    
    var srcCon = document.getElementById("hidSelSearchCon") ;
    var srcNm  = document.getElementById("hidConName");
    var curPage = document.getElementById("curPage");   
    
    srcCon.value = selSearchCon1;
    srcNm.value =  conName1;
    curPage.value = curPage1;
    
    carMasterSch();    
    
    brOrCmstStdCarInfo(); 
    fnInsertPopup('#carmastersearch');  
    

}

//대리점 선택
//카마스터를 삭제한다.
function brSet(brCd1){
    var callFlg = document.getElementById("callFlg");
    var brCd =  document.getElementById("brCd");
    var reqCmEeno = document.getElementById("reqCmEeno");
    var reqFlg = document.getElementById("reqFlg");
    reqFlg.value= "2"; //1 - 카마스터 상담  2-지점상담
    
    reqCmEeno.value = "";
    callFlg.value = "2";
    
    brCd.value = brCd1;
    
    
}


function mbrInfoView(){
    //지점코드
    var reqCtrCd = document.getElementById("reqCtrCd");
    var reqBrCd = document.getElementById("reqBrCd");
    var reqCmEeno = document.getElementById("reqCmEeno");
    var reqCarCd = document.getElementById("reqCarCd");
    var reqCarGrdCd = document.getElementById("carGrdSel");
    var reqCarGrdDtlCd = document.getElementById("carGrdDtlSel");
    var reqCarColorCd = document.getElementById("carColorSel");
    var callFlg = document.getElementById("callFlg");    
 
   if(reqCarGrdCd.value == ""){
       alert("등급을 선택하여 주십시요");
       reqCarGrdCd.focus();
       return ;
   }
    
   if(reqCarGrdDtlCd.value == ""){
       alert("상세 등급을 선택하여 주십시요");
       reqCarGrdDtlCd.focus();
       return ;
   }
   
   if(reqCarColorCd.value == ""){
       alert("컬러를 선택하여 주십시요");
       reqCarColorCd.focus();
       return ;
   }
    
    
    
    closeLayer('#counselpurchase');     


    fnInsertPopup('#personinfopopup-catalog2');   
}
//상담신청등록





function counselPurchaseReq(){
    //지점코드
    var reqCtrCd = document.getElementById("reqCtrCd");
    var reqBrCd = document.getElementById("reqBrCd");
    var reqCmEeno = document.getElementById("reqCmEeno");
    var reqCarCd = document.getElementById("reqCarCd");
    var reqCarGrdCd = document.getElementById("carGrdSel");
    var reqCarGrdDtlCd = document.getElementById("carGrdDtlSel");
    var reqCarColorCd = document.getElementById("carColorSel");
    var callFlg = document.getElementById("callFlg");    


   
    $.post("<c:url value='/pur/purReqReg.do'/>",
            {
                'reqCtrCd': reqCtrCd.value,
                'reqBrCd': reqBrCd.value,
                'reqCmEeno': reqCmEeno.value,
                'reqCarCd': reqCarCd.value,
                'reqCarGrdCd': reqCarGrdCd.value,
                'reqCarGrdDtlCd':reqCarGrdDtlCd.value,
                'reqCarColorCd':reqCarColorCd.value,
                'reqMbrSn' : ${userInfo.mbrSn},
                'reqScnCd' : callFlg.value
            },
            function(data){
           
                var result={};
                var items = $(data).find("item");
                items.each(function(index,element){
                   var name = $(this).find("name").text();
                   var value = $(this).find("value").text();
                   result[name] = value;  

                });
   
            }
        );          
        
  
    
    
}


function checkClose(){
    
    $("#counselpurchasecheck").hide();

}

function MyCmReq(){
    var MyCmReqID = document.getElementById("MyCmReqID");
    var callFlg = document.getElementById("callFlg");
    var cMstNo = document.getElementById("cMstNo");

    callFlg.value= "1";
  //   if(!${userInfo.cmEeno} ) 
   // cMstNo.value = ${userInfo.cmEeno};
   
    
    //카마스터 정보를 조회한다
    
 
    
    $.post("<c:url value='/pur/carMasterInfo.do'/>",
            {'cMstNo': cMstNo.value
            },
            function(data){
            
                var masterInfoList = [];
                var items = $(data).find("item");
                var ite = items.size();
                items.each(function(index,element){
                    var object ={};
                    var ctrCd = $(this).find("value").eq(0).text();
                    object["ctrCd"] = ctrCd;
                    var brCd = $(this).find("value").eq(1).text();
                    object["brCd"] = brCd;
                    var brNm = $(this).find("value").eq(2).text();
                    object["brNm"] = brNm;
                    var cmEeno = $(this).find("value").eq(3).text();
                   
                    object["cmEeno"] = cmEeno;
                    var cmNm = $(this).find("value").eq(4).text();
                    object["cmNm"] = cmNm;
                    var cmCcpc = $(this).find("value").eq(5).text();
                    object["cmCcpc"] = cmCcpc;
                    var cmEml = $(this).find("value").eq(6).text();
                    object["cmEml"] = cmEml;
                    var cmPhtg = $(this).find("value").eq(7).text();
                    object["cmPhtg"] = cmPhtg;
                    var cmGret = $(this).find("value").eq(7).text();
                    object["cmGret"] = cmGret;
                    masterInfoList[index] = object;
                });

                
                

                
                var cMstNo = document.getElementById("cMstNo");
                var  brCd =  document.getElementById("brCd");
                var  callFlg =  document.getElementById("callFlg");
                
                
                var reqCtrCd = document.getElementById("reqCtrCd");
                var reqBrCd  = document.getElementById("reqBrCd");
                var reqCmEeno  = document.getElementById("reqCmEeno");
                var reqBrScn  = document.getElementById("reqBrScn");
                var cMst = document.getElementById("cMst");
                var cEml = document.getElementById("cEml");
           
                cMst.innerHTML = masterInfoList[0]["brNm"] +'/' + masterInfoList[0]["cmNm"] ;
                cEml.innerHTML = masterInfoList[0]["cmCcpc"] + '/' + masterInfoList[0]["cmEml"] ;
                
                
                reqCtrCd.value = masterInfoList[0]["ctrCd"];
                reqBrCd.value = masterInfoList[0]["brCd"];
                reqCmEeno.value = masterInfoList[0]["cmEeno"];
                reqBrScn.value = "1";
                 
                cMstNo.value = masterInfoList[0]["cmEeno"] ;
                brCd.value = masterInfoList[0]["brCd"] ;
          
                
                callFlg.value = "1" ;                
                
              
                     
                }
            );         
        
    brOrCmstStdCarInfo();  
   
    //fnInsertPopup('#personinfopopup-catalog2');
    fnInsertPopup('#counselpurchase');

}



function counselReq(){
    
    var counselReqID = document.getElementById("counselReqID");
    
    var reqFlg =  document.getElementById("reqFlg");  

    if(reqFlg.value == "") {
       alert("카마스터 상담 또는 지점상담을 선택하십시요");
       //$('.dimmed-frame').hide();
       return false;
    }
    brOrCmstStdCarInfo();
    //fnInsertPopup('#personinfopopup-catalog2');
    fnInsertPopup('#counselpurchase');

    

}


function searchOne(){
    var srcCon = document.getElementById("selSearchCon") ;
    var srcNm  = document.getElementById("conName");
    
    var curPage = document.getElementById("curPage");

    
    if((srcCon.value  == "3") && (srcNm.value == "")){
        alert("지점/대리점명을 입력하세요 " );
        srcCon.focus();
        return ;
    } 
 
    if((srcCon.value  == "2") && (srcNm.value == "")){
        alert("성명을 입력하세요 " );
        srcNm.focus();
        return ;
    }   
    curPage.value = "1";    
    
    var selCon = document.getElementById("selSearchCon") ;
    var srcNm  = document.getElementById("conName");    
    
    var hidSelCon = document.getElementById("hidSelSearchCon") ;
    var hidSrcNm  = document.getElementById("hidConName");    
    
    hidSelCon.value = selCon.value;
    hidSrcNm.value = srcNm.value;
    
    carMasterSch();
}

function searchPage(curPage1){
   
    var curPage = document.getElementById("curPage");
    var srcCon = document.getElementById("hidSelSearchCon") ;
     var srcNm  = document.getElementById("hidConName");
    // var curPage = document.getElementById("curPage");
   
    curPage.value = curPage1;
    
    carMasterSch(); 
}

function carMasterSch(){
    var srcCon = document.getElementById("hidSelSearchCon") ;
    var srcNm  = document.getElementById("hidConName");
    var  curPage = document.getElementById("curPage");


/* 검색 결과를 구한다 */


    
    $.post("<c:url value='/pur/carMasterListPaging.do'/>",
            {'srcCon': srcCon.value,
            'srcNm' : srcNm.value,
            'curPage': curPage.value
           }, 
            function(data){
                var carMasterInfoList = [];
                var items = $(data).find("item");
                var ite = items.size();
                var Total = 0 ;
                var listIdx = 0 ;
                var rtnCurPage = 0 ;
                
                items.each(function(index,element){
                    var object ={};
                    var nameVal = $(this).find("name").text();

                    if( nameVal == "Total") {
                        Total = $(this).find("value").eq(0).text();
                       
                    }else if(nameVal == "curPage"){
                        rtnCurPage = $(this).find("value").eq(0).text();
                    }else
                    {
                        var ctrCd = $(this).find("value").eq(0).text();
                        object["ctrCd"] = ctrCd;
                        var brCd = $(this).find("value").eq(1).text();
                        object["brCd"] = brCd;
                        var brNm = $(this).find("value").eq(2).text();
                        object["brNm"] = brNm;
                        var cmEeno = $(this).find("value").eq(3).text();
                       
                        object["cmEeno"] = cmEeno;
                        var cmNm = $(this).find("value").eq(4).text();
                        object["cmNm"] = cmNm;
                        var cmCcpc = $(this).find("value").eq(5).text();
                        object["cmCcpc"] = cmCcpc;
                        var cmEml = $(this).find("value").eq(6).text();
                        object["cmEml"] = cmEml;
                        var cmPhtg = $(this).find("value").eq(7).text();
                        object["cmPhtg"] = cmPhtg;
                        var cmGret = $(this).find("value").eq(8).text();
                        object["cmGret"] = cmGret;
                        carMasterInfoList[listIdx] = object;
                        listIdx++;
                    }
                });
            
           
                var iRtn = 0 ;
                var inHTML = "";
                var inPageHTML = "";
                var iMod = 0;
                                
                if(carMasterInfoList.length > 0){

                     
                    for(var i=0; i < carMasterInfoList.length; i++){
               
                      inHTML = inHTML + '<tr>';
                      inHTML = inHTML + '<td class="center">';
                      inHTML = inHTML + '<div class="salesman-thumb"><img src="https://tops.hmc.co.kr/upload/photo/' +carMasterInfoList[i]["cmEeno"]+ '.jpg"/></div>';
                      inHTML = inHTML + '</td>';
                      inHTML = inHTML + '<td class="last">';
                      inHTML = inHTML + '<div class="salesman-information">';
                      inHTML = inHTML + '<ul>';
                      inHTML = inHTML + '<li>';
                      inHTML = inHTML + '<em class="d-tit"><img src="/kr/images/layerpopup/txt_branch01.gif" alt="성명" /></em>';
                      inHTML = inHTML + '<p class="d-txt">' + carMasterInfoList[i]["cmNm"] + '</p>';
                      inHTML = inHTML + '</li>';
                      inHTML = inHTML + '<li>';
                      inHTML = inHTML + '<em class="d-tit"><img src="/kr/images/layerpopup/txt_branch02.gif" alt="소속" /></em>';
                      inHTML = inHTML + '<p class="d-txt">' + carMasterInfoList[i]["brNm"] + '</p>';
                      inHTML = inHTML + '</li>';
                      inHTML = inHTML + '<li>';
                      inHTML = inHTML + '<em class="d-tit"><img src="/kr/images/layerpopup/txt_branch03.gif" alt="휴대전화" /></em>';
                      inHTML = inHTML + '<p class="d-txt">' + carMasterInfoList[i]["cmCcpc"] + '</p>';
                      inHTML = inHTML + '</li>';
                      inHTML = inHTML + '<li>';
                      inHTML = inHTML + '<em class="d-tit"><img src="/kr/images/layerpopup/txt_branch04.gif" alt="이메일" /></em>';

                      inHTML = inHTML + '<p class="d-txt">' + carMasterInfoList[i]["cmEml"] + '</p>';
                      
                      inHTML = inHTML + '</li>';
                      inHTML = inHTML + '<li>';
                      inHTML = inHTML + '<em class="d-tit"><img src="/kr/images/layerpopup/txt_branch05.gif" alt="인사말" /></em>';
                      
                      inHTML = inHTML + '<p class="d-txt">' + carMasterInfoList[i]["cmGret"] + '</p>';

                      
                      
                      inHTML = inHTML + '</li>';
                      inHTML = inHTML + '</ul>';
                      inHTML = inHTML + '<a href="javascript:cMstSeleted(\'' + carMasterInfoList[i]["cmEeno"]    +'\',\'' +  carMasterInfoList[i]["brCd"] +'\',\'' +  carMasterInfoList[i]["ctrCd"]  +'\',\'' +  carMasterInfoList[i]["brNm"] +'\',\'' +  carMasterInfoList[i]["cmNm"] +'\',\'' +  carMasterInfoList[i]["cmCcpc"] +'\',\'' +  carMasterInfoList[i]["cmEml"]+ '\')"><img src="/kr/images/layerpopup/btn_select.gif" alt="선택" class="application" /></a>';
                      inHTML = inHTML + '</div>';
                      inHTML = inHTML + '</td>';
                      inHTML = inHTML + '</tr>';
                       
                     }
                
                inHTML = inHTML + '<tr>';
                inHTML = inHTML + '<td colspan="2" class="center last">성명 또는 지점/대리점명을 입력하시고 조회 해주세요!</td>';
                inHTML = inHTML + '</tr>';
               
                
                    //inHTML = inHTML + '</tbody>';
                    //카마스터 List 끝
                    

              
                    $('#carMasterInfos').html('');
                    $('#carMasterInfos').html(inHTML);
                    //document.getElementById("carMasterInfos").innerHTML = inHTML ;

                    
                    
                    
                    var totalPage = 0;
                    
                    if((Total % 5 ) > 0 ){
                        totalPage = Total / 5 + 1;
                    }else{
                        totalPage = Total / 5 ;
                    }
                   
                    inPageHTML = inPageHTML + '<input type="hidden" name="totalPage" id="totalPage" value="'+ totalPage + '">';
          
                    if(totalPage > 1){
                        
                        inPageHTML = inPageHTML + '<a href="javascript:PreView(' + rtnCurPage + ')"><img src="/kr/images/common/button/btn_prev.gif" alt="이전" /></a>';  
                    }
                    inPageHTML = inPageHTML + '<span class="num">';
                   
                    for (var i = 1 ; i <= totalPage ; i++){
                         
                        if( i == rtnCurPage){
                            inPageHTML = inPageHTML + '<a href="javascript:searchPage(' + i + ')" class="on" > ' + i + '</a>';  
                        }else{
                            inPageHTML = inPageHTML + '<a href="javascript:searchPage(' + i + ')"  > ' + i + '</a>';  
                        }
                        
                   
                        
                    }

                    inPageHTML = inPageHTML + '</span>';

                    
                    if(totalPage > 1){
                        
                        inPageHTML = inPageHTML + '<a href="javascript:NextView(' + rtnCurPage + ')"><img src="/kr/images/common/button/btn_next.gif" alt="다음" /></a>';  
                    }

                
                    document.getElementById("cMstPaging").innerHTML = inPageHTML ;
                    
               }else{//해당 지점의 카마스터가 존재하지않으면
                   inHTML = inHTML + '<tr>';
                   inHTML = inHTML + '<td colspan="2" class="center last">성명 또는 지점/대리점명을 입력하시고 조회 해주세요!</td>';
                   inHTML = inHTML + '</tr>';
                  
                
                       $('#carMasterInfos').html('');
                       $('#carMasterInfos').html(inHTML);                   
                       document.getElementById("cMstPaging").innerHTML = '' ;
 
               }
   
            }
        );      

     
}


function PreView(curPage1){
    

    if(curPage1 == '1') {
        alert("이전페이지가 없습니다.");
        return ;
    }
    var srcCon = document.getElementById("hidSelSearchCon") ;
    var srcNm  = document.getElementById("hidConName");    
    var curPage = document.getElementById("curPage");
    
    curPage.value = curPage1 - 1 ;
    
    carMasterSch(); 
   
}

function NextView(curPage1){
    

    
    var totalPage = document.getElementById("totalPage");

    if(curPage1 >= totalPage.value){
        alert("다음 페이지가 없습니다.");
        return ;       
    }
    var srcCon = document.getElementById("hidSelSearchCon") ;
    var srcNm  = document.getElementById("hidConName");    
    
    var curPage = document.getElementById("curPage");
   

    curPage.value = (curPage1 + 1) ;
     
    carMasterSch(); 
   
}

function cMstSeleted(cmEeno1 , brCd1,ctrCd1,brNm1,cmNm1,cmCcpc1,cmEml1){
    
    var chgMasterFlg = document.getElementById("chgMasterFlg");
    
    //chgMasterFlg.value = "Y";

    //마스터 신청 또는 변경인 경우
    if(chgMasterFlg.value == 'Y'){
        
        $.post("<c:url value='/pur/changeCarMaster.do'/>",
                {
                    'mbrSn' : ${userInfo.mbrSn},
                    'cmEeno'     : cmEeno1
                },
                function(data){
              
                    var result={};
                    var items = $(data).find("item");
                    items.each(function(index,element){
                       var name = $(this).find("name").text();
                       var value = $(this).find("value").text();
                       result[name] = value;
                    });
                    
                 
                    if(result["result"] =="OK"){
                        
                        var frm = $("#carMasterSearchForm")[0];
                        //frm.action="<c:url value='/pur/purCounselReqPaging.do'/>";
                       // location.reload();
                        frm.submit();

                    //if(reqURL == "") reqURL = '/pur/purCounselReqPaging.do';

                    //returnReDirectURL(reqURL) ;
                    
                     return true;
                     
                    }
                        
                }  
            );  
               
        
        closeLayer('#carmastersearch');    
        brOrCmstStdCarInfo();
        
        

        
    }else {
        var cMstNo = document.getElementById("cMstNo");
        var  brCd =  document.getElementById("brCd");
        var  callFlg =  document.getElementById("callFlg");
        
        
        var reqCtrCd = document.getElementById("reqCtrCd");
        var reqBrCd  = document.getElementById("reqBrCd");
        var reqCmEeno  = document.getElementById("reqCmEeno");
        var reqBrScn  = document.getElementById("reqBrScn");
        var cMst = document.getElementById("cMst");
        var cEml = document.getElementById("cEml");
           
        cMst.innerHTML = brNm1 +'/' + cmNm1 ;
        cEml.innerHTML = cmCcpc1 + '/' + cmEml1 ;
        
        
        reqCtrCd.value = ctrCd1;
        reqBrCd.value = brCd1;
        reqCmEeno.value = cmEeno1;
        reqBrScn.value = "1";
         
        cMstNo.value = cmEeno1 ;
        brCd.value = brCd1 ;
        callFlg.value = "1" ;
        closeLayer('#carmastersearch');     
        fnInsertPopup('#counselpurchase');
        //fnInsertPopup('#personinfopopup-catalog2');
    }
}


function fnInsertPopup(area){
  
    $(area).height('');
    $('body').dimmedFrame();
    $('.dimmed-frame').css({height:$("#wrap").height()});
    $(area).css("display", "");
    $(area).css({top:$(window).scrollTop()+150}).show();
}
function closeLayer(area){
   // $(area).html('');
    $('.dimmed-frame').remove();
    $(area).hide(); 
} 


function changeMaster(){
    //카마스터 변경 또는 카마스터 신청이다.
    var chgMasterFlg = document.getElementById("chgMasterFlg");
    
    chgMasterFlg.value = 'Y';
    //카마스터의 내용이 조회된 것이 있을수 있으니 초기화 한다.
    
    //document.getElementById("carMasterInfos").innerHTML = "" ;
$('#carMasterInfos').html('');
$('#cMstPaging').html('');
   // document.getElementById("cMstPaging").innerHTML ="";   
    fnInsertPopup('#carmastersearch');   
}


</script>

</head>
<body>
<!-- 카마스터 조회 관련 -->
<div id="carmastersearch" class="layerpopup carmastersearch"><div class="layerpopup-inner">
<form name="carMasterSearchForm" id="carMasterSearchForm" onsubmit="return false">
   <input type="hidden" id="curPage" name="curPage" value="">
   <input type="hidden" id="hidSelSearchCon" name="hidSelSearchCon" value="">
   <input type="hidden" id="hidConName" name="hidConName" value="">
   <input type="hidden" id="imagepath" name="imagepath" value="">
    <div class="layerpopup-head">
        <h1><img src="/kr/images/layerpopup/h1_carmaster_search.gif" alt="카마스터 조회" /></h1>
        <p class="desc"><img src="/kr/images/layerpopup/h1_carmaster_search1_desc.gif" alt="고객님이 찾으시는 카마스터를 안내해 드립니다." /></p>
    </div>
    <div class="layerpopup-contents">
        <div class="carmaster-search-wrap">
            <p class="search-tip"><img src="/kr/images/layerpopup/txt_carmaster_search02.gif" alt="카마스터 찾기 : 고객님이 구매상담을 희망하시는 카마스터를 선택 할 수 있습니다." /></p>
            <div class="list-search-form02 subsection02">
                <select  class="select select-type2" style="width:230px;" id="selSearchCon" name="selSearchCon">
                    <option value="3" selected>지점/대리점 명</option>
                    <option value="2">성명</option>
                    
                </select>
                <input type="text" class="txt" style="width:225px;" id="conName" name="conName"/>
                <a href="javascript:searchOne()"><img src="/kr/images/common/button/btn_search03.gif"  alt="SEARCH"/></a>
            </div>
            <h2 class="subsection02"><img src="/kr/images/title/h5_counsel_branch_inquiry02_01.gif" alt="검색 결과" /></h2>
            <div class="boardlist-wrap">
                <table class="salesman-search" summary="이미지, 내용">
                <caption>검색 결과 리스트</caption>
                <colgroup>
                    <col width="20%" />
                    <col width="80%" />
                </colgroup>
                <thead>
                <tr>
                    <th scope="col">이미지</th>
                    <th scope="col">내용</th>
                </tr>
                </thead>
                </table>
                </>
            </div>
            <div class="boardlist-wrap" >
            <table id="carMasterInfos" name="carMasterInfos" >
            
       
            </table>
            
            
            
            </div>
            
            
            
            
            <div class="paging" id="cMstPaging" name="cMstPaging">
           </div>
        </div>
    </div>

    <!-- close -->
    <div class="close-area">
        <div class="close-area-inner">
        <img src="/kr/images/layerpopup/btn_close.gif" alt="닫기" class="close" />
        </div>
    </div>
    <!-- //close -->
    </form>
</div>

</div>
<!-- //카마스터 조회 관련 -->



<!-- 구매상담 신청 -->
<div id="personinfopopup-catalog2" class="layerpopup personinfopopup-catalog" >
<div class="layerpopup-inner">
    <div class="layerpopup-head">
        <h1><img src="/kr/images/layerpopup/h1_person_info.gif" alt="개인정보입력" /></h1>
    </div>
<form id="purCounselCefForm" name="purCounselCefForm" method="post" onsubmit="return false">
     <input type="hidden" name="zipScn" id="zipScn" value="${userInfo.zipScn }">
     <input type="hidden" name="wpaNm1" id="wpaNm1" value="${purMgmtSearchVO.wpaNm}">
     <input type="hidden" name="admzNm1" id="admzNm1" value="${purMgmtSearchVO.brDtlAdr2 }">
     <c:if test="${userInfo.cmEeno !=''}">
     <input type="hidden" name="callFlg" id="callFlg"  value="1">
     </c:if>
      <c:if test="${userInfo.cmEeno ==''}">
     <input type="hidden" name="callFlg" id="callFlg"  value="">
     </c:if>
     
     <input type="hidden" name="brCd"   id="brCd" value="">

    <div class="layerpopup-contents">
   
        <div class="person-info-wrap">
            <h2 class="person-rule"><img src="/kr/images/layerpopup/h2_person_info.gif" alt="개인정보 수집, 이용에 관한 안내" /></h2>
            <div class="rule"><div class="inner" style="overflow-y:auto">
     ${purAgrSbcList.sbc1 }
            </div></div>

            <div class="etc-function">
                <label><input type="checkbox" class="check" id="perAgrChk" name="perAgrChk"/> 개인정보 수집 및 이용 목적에 동의합니다.(동의하지 않을 경우 신청 되지 않습니다.)</label>
            </div>
            <div class="etc-function">
                <label><input type="checkbox" class="check" id="mktAgrChk" name="mktAgrChk"/> 마케팅 활용에 동의합니다(동의하지 않을 경우 신청되지 않습니다.)</label>
            </div>
            <div class="etc-function">
                <label><input type="checkbox" class="check" id="agrChk" name="agrChk"/> 개인 정보 보유 및 이용기간에 동의합니다(동의하지 않을 경우 신청되지 않습니다.)</label>
            </div>
            <p class="desc"><img src="/kr/images/layerpopup/h1_person_info_desc03.gif" alt="구매상담 신청을 위한 고객님의 개인정보를 확인 또는 입력해 주세요." /></p>
           
                <table summary="">
                <colgroup>
                    <col width="20%" />
                    <col />
                </colgroup>
                <tbody>
                <tr>
                    <th scope="row"><img src="/kr/images/layerpopup/txt_person_info01.png" alt="성명" /></th>
                    <td class="input">
                        <input type="text" class="txt" style="width:194px" value="${userInfo.mbrNm }" readonly/>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><img src="/kr/images/layerpopup/txt_person_info02.png" alt="휴대전화 번호" /></th>
                    <td class="input">
                       
                        <select class="select select-type1" style="width:56px;" id="mobileCom" name="mobileCom">
                            <option value="010" <c:if test="${ userInfo.hpNo1 == '010' }">selected="selected"</c:if>>010</option>
                            <option value="011" <c:if test="${ userInfo.hpNo1 == '011' }">selected="selected"</c:if>>011</option>
                            <option value="016" <c:if test="${ userInfo.hpNo1 == '016' }">selected="selected"</c:if>>016</option>
                            <option value="017" <c:if test="${ userInfo.hpNo1 == '017' }">selected="selected"</c:if>>017</option>
                            <option value="018" <c:if test="${ userInfo.hpNo1 == '018' }">selected="selected"</c:if>>018</option>
                            <option value="019" <c:if test="${ userInfo.hpNo1 == '019' }">selected="selected"</c:if>>019</option>
                        </select>
                        -
                        <input type="text" class="txt" style="width:52px" title="앞자리 입력" name="hpNo2" id="hpNo2" value=${ userInfo.hpNo2}>
                        -
                        <input type="text" class="txt" style="width:52px" title="뒷자리 입력" name="hpNo3" id="hpNo3" value=${ userInfo.hpNo3}>
                    </td>
                </tr>
              
 
                
                
                <tr>
                    <th scope="row"><img src="/kr/images/layerpopup/txt_person_info07.png" alt="생년월일" /></th>
                    <td class="input">
                        <select class="select select-type1" style="width:60px; overflow-" id="tymdYYYY">
                            <c:set value="2012" var="num2" />
                            <c:forEach var="i" begin="0" varStatus="status" end="107"> 
                                <c:if test="${fn:substring(userInfo.tymd, 0, 4) == (num2 - status.index)}">
                                    <option value="<fmt:formatNumber minIntegerDigits="2" value="${num2 - status.index}" pattern="##"/>" selected="selected"><fmt:formatNumber minIntegerDigits="2" value="${num2 - status.index}" pattern="##"/></option>
                                </c:if> 
                                <c:if test="${fn:substring(userInfo.tymd, 0, 4) != (num2 - status.index)}">
                                    <option value="<fmt:formatNumber minIntegerDigits="2" value="${num2 - status.index}" pattern="##"/>"><fmt:formatNumber minIntegerDigits="2" value="${num2 - status.index}" pattern="##"/></option>
                                </c:if>
                                
                            </c:forEach>
                        </select>
                        <span class="in-input">년</span>
                        <select class="select select-type1 space" style="width:56px;" id="tymdMM">
                            <c:forEach var="i" begin="1" varStatus="status" end="12">
                                <fmt:formatNumber minIntegerDigits="2" value="${status.index}" pattern="##" var="selectNum"/>
                                <c:if test="${fn:substring(userInfo.tymd, 4, 6) == selectNum}">  
                                    <option value="${selectNum }" selected="selected">${selectNum }</option>
                                </c:if> 
                                <c:if test="${fn:substring(userInfo.tymd, 4, 6) != status.index}">
                                   <option value="<fmt:formatNumber minIntegerDigits="2" value="${status.index}" pattern="##"/>"><fmt:formatNumber minIntegerDigits="2" value="${status.index}" pattern="##"/></option>
                                </c:if>
                            </c:forEach>
                        </select> 
                        <span class="in-input">월</span>
                        <select class="select select-type1 space" style="width:56px;" id="tymdDD">
                            <c:forEach var="i" begin="1" varStatus="status" end="31">
                                <fmt:formatNumber minIntegerDigits="2" value="${status.index}" pattern="##" var="selectNum"/>
                                <c:if test="${fn:substring(userInfo.tymd, 6, 8) == status.index}">
                                    <option value="${selectNum }" selected="selected">${selectNum }</option>
                                </c:if> 
                                <c:if test="${fn:substring(userInfo.tymd, 6, 8) != status.index}">
                                   <option value="${selectNum }">${selectNum }</option>
                                </c:if>
                            </c:forEach>
                        </select>
                        <span class="in-input">일</span>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><img src="/kr/images/layerpopup/txt_person_info08.png" alt="성별" /></th>
                    <td class="input">
                        <select class="select select-type1"  style="width:56px;" id="mbrSex" name="mbrSex">
                            <option value="M" <c:if test="${ userInfo.mbrSex =='M' }">selected="selected"</c:if>> 남</option>
                            <option value="F"  <c:if test="${ userInfo.mbrSex =='F' }">selected="selected"</c:if>>여</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><img src="/kr/images/layerpopup/txt_person_info03.png" alt="주소(거주지)" /></th>
                    <td class="input">
                        <input type="text" class="txt" style="width:52px" value="${userInfo.zipSn1 }" name="zipSn01" id="zipSn01" readonly/>
                        -
                        <input type="text" class="txt" style="width:52px" value="${userInfo.zipSn2 }" name="zipSn02" id="zipSn02" readonly />
                        <a href="javascript:zipCodePopUp('zipCode');"><img src="/kr/images/layerpopup/btn_zipcode.gif" alt="우편번호 검색" /></a>
                        <div class="sect">                                                                
                            <input type="text" class="txt" style="width:378px" name="adr" id="adr" value="<c:out value= '${userInfo.adr }'/>" title="나머지 주소 입력" readonly/>
                        </div>
                        <div class="sect">
                            <input type="text" class="txt" style="width:378px" name="dtlAdr" id="dtlAdr" value="${userInfo.dtlAdr }" title="나머지 주소 입력" readonly/>
                        </div>
                    </td>
                </tr>
                </tbody>
                </table>
       
            <p class="default-tip">
                * 정확한 개인정보를 입력하지 않으시면 서비스 이용에 불이익이 있을 수 있습니다.<br />
                * 새로 입력된 정보는 가입정보에 반영되어 업데이트 됩니다.<br />
                * 본 개인정보는 온라인 발송업체에 제공됩니다.
            </p>
        </div>
        <div class="btnwrap">
            <a href="javascript:void(0)"><img src="/kr/images/layerpopup/btn_confirm02.gif" alt="확인" onClick="mbrInfoUpdate();"/></a>
            <a href="#"><img src="/kr/images/layerpopup/btn_cancel.gif" alt="취소" class="close"/></a>
        </div>
   
    </div>
    <!-- close -->
    <div class="close-area"><div class="close-area-inner">
        <img src="/kr/images/layerpopup/btn_close.gif" alt="닫기" class="close" />
    </div></div>
    <!-- //close -->
    </form>
</div>

</div>
<!-- //구매상담 신청 --> 


<!-- 구매상담 신청 관련 -->
<div id="counselpurchase" class="layerpopup counselpurchase" style="z-index:1000">
<div class="layerpopup-inner">
<form name="couselPurchaseForm" id= "couselPurchaseForm" onsubmit="return false">
    <input type="hidden" id="reqCtrCd" name="reqCtrCd" value= "">
    <input type="hidden" id="reqBrCd" name="reqBrCd" value="">
    <input type="hidden" id="reqCmEeno" name="reqCmEeno" value="${userInfo.cmEeno}">
    <input type="hidden" id="reqBrScn" name="reqBrScn" value="">
    <input type="hidden" id="reqCarCd" name="reqCarCd" value="">

    <div class="layerpopup-head">
        <h1><img src="/kr/images/layerpopup/h1_counsel_purchase.gif" alt="구매상담 신청" /></h1>
    </div>
    <div class="layerpopup-contents">
        <div class="counsel-purchase-wrap">
            <h2><img src="/kr/images/layerpopup/h2_counsel_purchase03.gif" alt="지점 정보" /></h2>
            <div id="CmstInfoDiv" name="CmstInfoDiv" style="dispaly:none">
            <div class="datatable-wrap02" >
                <table summary="지점명/담당, 연락처/이메일">
                <caption>카마스터 정보 리스트</caption>
                <colgroup>
                    <col width="25%" />
                    <col />
                </colgroup>
                <tbody>
                <tr>
                    <th scope="row" >지점명/담당</th>
                    <td id="cMst" name="cMst"></td>
                </tr>
                <tr>
                    <th scope="row">연락처/이메일</th>
                    <td id="cEml" name="cEml"></td>
                </tr>
                </tbody>
                </table>
            </div>
            </div>
            <!-- type2 -->
            <div id="brInfoDiv" name="brInfoDiv" style="dispaly:none">
            <div class="datatable-wrap02" >
                <table summary="지점명, 연락처">
                <caption>카마스터 정보 리스트</caption>
                <colgroup>
                    <col width="25%" />
                    <col />
                </colgroup>
                <tbody>
                <tr>
                    <th scope="row" >지점명</th>
                    <td id="reqBrNm" name="reqBrNm"></td>
                </tr>
                <tr>
                    <th scope="row" >연락처</th>
                    <td id="reqBrCcpc" name="reqBrCcpc"></td>
                </tr>
                </tbody>
                </table>
            </div>
            </div>
            <!-- //type2 -->
            <h2 class="subsection03"><img src="/kr/images/layerpopup/h2_counsel_purchase02.gif" alt="차량 선택" /></h2>
            <div class="exhibit-car-list-wrap">
                <div class="exhibit-car-list" id="carInfoDiv" name="carInfoDiv">

                </div>
                <div class="grade-select">
                    <span id="spCarGrdSel" name="spCarGrdSel">
                    <select  class="select select-type2" style="width:240px;" id="carGrdSel" name="carGrdSel" onChange="carGrdDtlSearch()">
                        <option value="">등급선택</option>
                    </select>
                    </span>
                    <span id="spCarGrdDtlSel" name="spCarGrdDtlSel">
                    <select  class="select select-type2" style="width:240px;" id="carGrdDtlSel" name="carGrdDtlSel">
                        <option value="">상세등급선택</option>
                    </select>
                    </span>
                    <span id="spCarColorSel" name="spCarColorSel">
                    <select class="select select-type2" style="width:240px;" id="carColorSel" name="carColorSel">
                        <option value="">컬러선택</option>
                    </select>
                    </span>
                    <p class="caution">* 상기 이미지는 실제와 다를 수 있습니다.</p>

                </div>
            </div>
            <div class="btnwrap">
                <a href="javascript:void(0)"><img src="/kr/images/layerpopup/btn_counsel_application.gif" alt="상담신청" onClick="mbrInfoView();"/></a>
                <a href="#"><img src="/kr/images/layerpopup/btn_cancel02.gif" alt="취소" class="close"/></a>
            </div>
        </div>
    </div>
    <!-- close -->
    <div class="close-area"><div class="close-area-inner">
        <img src="/kr/images/layerpopup/btn_close.gif" alt="닫기" class="close" />
    </div></div>
    <!-- //close -->
    </form>
</div>

</div>
<!-- //구매상담 신청 관련 -->

<!-- 구매상담 신청내역 확인 -->
<div id="counselpurchasecheck" class="layerpopup counselpurchasecheck" style="z-index:100000"><div class="layerpopup-inner">
    <div class="layerpopup-head">
        <h1><img src="/kr/images/layerpopup/h1_counsel_purchase02.gif" alt="구매상담 신청내역 확인"/></h1>
    </div>
    <div class="layerpopup-contents">
        <div class="application-check-wrap">
            <p class="stats02">
                ${userInfo.mbrNm } <img src="/kr/images/layerpopup/txt_application_check01.gif" alt="고객님의 서비스가 신청되었습니다." />
            </p>
        </div>
        <div class="btnwrap">
            <a href="/kr/pur/purCounselReqPaging.do"><img src="/kr/images/layerpopup/btn_confirm02.gif" alt="확인" class="close" /></a>
        </div>
    </div>
    <!-- close -->
    <div class="close-area"><div class="close-area-inner">
        <img src="/kr/images/layerpopup/btn_close.gif" alt="닫기" class="close" onClick="checkClose()"/>
    </div></div>
    <!-- //close -->
</div></div>
<!-- //구매상담 신청내역 확인 -->

<!-- 구매상담 신청내역 실패 확인 -->
<div id="counselpurchaNonCheck" class="layerpopup counselpurchasecheck" style="z-index:100000"><div class="layerpopup-inner">
    <div class="layerpopup-head">
        <h1><img src="/kr/images/layerpopup/h1_counsel_purchase02.gif" alt="구매상담 신청내역 확인"/></h1>
    </div>
    <div class="layerpopup-contents">
        <div class="application-check-wrap">
            <p class="stats02">
                ${userInfo.mbrNm } <!-- <img src="/kr/images/layerpopup/txt_application_check01.gif" alt="고객님의 서비스가 신청되었습니다." /> -->
                고객님의 서비스 신청이 실패 하였습니다. 다시 신청해 주세요.
            </p>
        </div>
        <div class="btnwrap">
            <a href="/kr/pur/purCounselReqPaging.do"><img src="/kr/images/layerpopup/btn_confirm02.gif" alt="확인" class="close" /></a>
        </div>
    </div>
    <!-- close -->
    <div class="close-area"><div class="close-area-inner">
        <img src="/kr/images/layerpopup/btn_close.gif" alt="닫기" class="close" onClick="checkClose1()"/>
    </div></div>
    <!-- //close -->
</div></div>
<!-- //구매상담 신청내역 실패 확인 -->

<!-- 구매상담 신청 2주 제한 확인 -->
<div id="counselpurchaWeekNonCheck" class="layerpopup counselpurchasecheck" style="z-index:1000"><div class="layerpopup-inner">
    <div class="layerpopup-head">
        <h1><img src="/kr/images/layerpopup/h1_counsel_purchase02.gif" alt="구매상담 신청내역 확인"/></h1>
    </div>
    <div class="layerpopup-contents">
        <div class="application-check-wrap" id="regdtm">
        </div>
        <div class="btnwrap">
            <a href="/kr/pur/purCounselReqPaging.do"><img src="/kr/images/layerpopup/btn_confirm02.gif" alt="확인" class="close" /></a>
        </div>
    </div>
    <!-- close -->
    <div class="close-area"><div class="close-area-inner">
        <img src="/kr/images/layerpopup/btn_close.gif" alt="닫기" class="close" onClick="checkClose2()"/>
    </div></div>
    <!-- //close -->
</div></div>
<!-- //구매상담 신청 2주 제한 확인 -->

<%@ include file="/WEB-INF/jsp/com/include/layerpopup.jspf" %>
<div id="wrap" class="non-subnavigation">

    <hr />
  
    <%@ include file="/WEB-INF/jsp/com/include/sub_header_counsel02.jspf" %>
    <hr />

    <div id="container">
        <div id="subtitle-area"><div class="subtitle-area-inner">
            <%@ include file="/WEB-INF/jsp/com/include/location.jspf" %>
        </div></div>
        <form id="PurCounselReqForm" name="PurCounselReqForm" method="post" onsubmit="return false">
        <!--  검색 방법은 2가지이다 -->
        <!--  1. 초기 화면 로딩시 고객의 주소를 기준으로 지점을 조회하여 페이징하는 방법-->
        <!--  2. 고객이 지점찾기를 통하여 지점을 조회하여 페이징 하는 방법 -->
        <!--  위 두가지에 따라 조회 Query가 변경되어야 한다. -->
        <!--  '1' : 초기 고객주소기준 조회  ,  '2' : 고객 지점찾기기준 조회 -->
        <input type="hidden" id="purScn" name="purScn" value="<c:out value="${purMgmtSearchVO.purScn}"/>"/> 
        <input type="hidden" name="pageIndex" id="pageIndex" value="<c:out value="${purMgmtSearchVO.pageIndex}"/>">
        <input type="hidden" name="selList" id="selList" value="">
        <input type="hidden" name="wpaCd1" id="wpaCd1" value="<c:out value="${purMgmtSearchVO.wpaCd}"/>">
        <input type="hidden" name="agentCd" id="agentCd" value="<c:out value="${purMgmtSearchVO.brDtlAdr2}"/>">
        <input type="hidden" name="brCheckFlg" id="brCheckFlg" value="<c:out value="${purMgmtSearchVO.brScn1Yn}"/>">
        <input type="hidden" name="agntCheckFlg" id="agntCheckFlg" value="<c:out value="${purMgmtSearchVO.brScn2Yn}"/>">
        <input type="hidden" name="cMstNo" id="cMstNo" value="<c:out value="${userInfo.cmEeno}"/>">
        <input type="hidden" name="reqFlg" id="reqFlg" value="">
        <input type="hidden" name="chgMasterFlg" id="chgMasterFlg" value="">
        <input type="hidden" name="wpaNm" id="wpaNm" value="<c:out value="${purMgmtSearchVO.wpaNm }"/>">

        
        <div id="article">
            <p class="default-desc"><img src="/kr/images/counsel/txt_counsel_purchase02_01.gif" alt="고객님께서 원하는 지점을 선택하여 상담신청을 하시면 신속하고 친절하게 차량구매에 대한 모든 궁금증을 해결해 드리겠습니다." /></p>
            <div class="carmaster-stats" style="display:none">
                <div class="stats-area" >
                <c:if test="${fn:length(userInfo.cmNm)> 0}">
                    <b><span class="point04"><c:out value="${userInfo.mbrNm}"/></span> 님의 <span class="point04">카마스터</span></b>는<br/>
                        <b><span class="point04"><c:out value="${userInfo.brNm}"/>(<c:out value="${userInfo.brCcpc }"/>) <c:out value="${userInfo.cmNm }"/></span></b>카마스터입니다

                    <div class="btn">
                        <a href="#" class="layer-control" id="MyCmReqID" ><img src="/kr/images/common/button/btn_counsel_application.gif" alt="상담신청하기" onclick="MyCmReq()"/></a>
                         <a href="#"><img src="/kr/images/common/button/btn_carmaster_change.gif" alt="카마스터 변경" onClick="changeMaster()"/></a>
                    </div>
                 </c:if>                
                <c:if test="${fn:length(userInfo.cmNm)<= 0}">
                    <b><span class="point04">${userInfo.mbrNm}</span> 님의 <span class="point04">카마스터</span></b>를 등록하세요.
                    <div class="btn">
                        <a href="#"><img src="/kr/images/common/button/btn_carmaster_application.gif" alt="카마스터 신청" onClick="changeMaster()"/></a>
                    </div>
                </c:if>

                </div>
            </div>
            <h4 class="subsection in-contents"><img src="/kr/images/title/h4_counsel_purchase02_01.gif" alt="검색 결과" /></h4>
            <div class="list-search-form03">
                <b class="sort-sub">지역으로 찾기</b>
                <select class="select select-type2" style="width:200px;" name="selWpaNm" id="selWpaNm" onChange="searchAdmz()">
                    <option value="">광역시/도</option>
                    <option value="서울" <c:if test="${ purMgmtSearchVO.wpaNm == '서울' }">selected="selected"</c:if>>서울특별시</option>
                    <option value="인천" <c:if test="${ purMgmtSearchVO.wpaNm == '인천' }">selected="selected"</c:if>>인천광역시</option>
                    <option value="대전" <c:if test="${ purMgmtSearchVO.wpaNm == '대전' }">selected="selected"</c:if>>대전광역시</option>
                    <option value="대구" <c:if test="${ purMgmtSearchVO.wpaNm == '대구' }">selected="selected"</c:if>>대구광역시</option>
                    <option value="울산" <c:if test="${ purMgmtSearchVO.wpaNm == '울산' }">selected="selected"</c:if>>울산광역시</option>
                    <option value="광주" <c:if test="${ purMgmtSearchVO.wpaNm == '광주' }">selected="selected"</c:if>>광주광역시</option>
                    <option value="부산" <c:if test="${ purMgmtSearchVO.wpaNm == '부산' }">selected="selected"</c:if>>부산광역시</option>
                    <option value="제주" <c:if test="${ purMgmtSearchVO.wpaNm == '제주' }">selected="selected"</c:if>>제주자치도</option>
                    <option value="경기" <c:if test="${ purMgmtSearchVO.wpaNm == '경기' }">selected="selected"</c:if>>경기도</option>
                    <option value="강원" <c:if test="${ purMgmtSearchVO.wpaNm == '강원' }">selected="selected"</c:if>>강원도</option>
                    <option value="충남" <c:if test="${ purMgmtSearchVO.wpaNm == '충남' }">selected="selected"</c:if>>충청남도</option>
                    <option value="충북" <c:if test="${ purMgmtSearchVO.wpaNm == '충북' }">selected="selected"</c:if>>충청북도</option>
                    <option value="경남" <c:if test="${ purMgmtSearchVO.wpaNm == '경남' }">selected="selected"</c:if>>경상남도</option>
                    <option value="경북" <c:if test="${ purMgmtSearchVO.wpaNm == '경북' }">selected="selected"</c:if>>경상북도</option>
                    <option value="전남" <c:if test="${ purMgmtSearchVO.wpaNm == '전남 ' }">selected="selected"</c:if>>전라남도</option>
                    <option value="전북" <c:if test="${ purMgmtSearchVO.wpaNm == '전북' }">selected="selected"</c:if>>전라북도</option>
                    
                       <!-- 
                        <c:forEach var="pwlist" items="${pwaList}" varStatus="status">
                                <option value="${pwlist.cdNm}"  <c:if test="${ purMgmtSearchVO.wpaNm == pwlist.cdNm }">selected="selected"</c:if>>${pwlist.cdNm }</option>        
                        </c:forEach> 
                       -->                     
                </select>
                <span id="brDtlAdr12" name="brDtlAdr12">
                <select class="select select-type2"  style="width:200px;" id="brDtlAdr2" name="brDtlAdr2">

                </select>
                </span>
                <span class="detail-check">
                    <label><input type="checkbox" class="check" id="allCheck" name="allCheck" onClick="allChecked()"> 전체</label>
                    <label><input type="checkbox" class="check space" id="brCheck" name="brCheck"  onClick="brChk()" <c:if test="${ purMgmtSearchVO.brScn1Yn == 'Y' }">checked=true</c:if> <c:if test="${ purMgmtSearchVO.brScn1Yn == '' }">checked=true</c:if>> 지점</label>
                    <label><input type="checkbox" class="check space" id="agntCheck" name="agntCheck" onClick="agntChk()" <c:if test="${ purMgmtSearchVO.brScn2Yn == 'Y' }">checked=true</c:if><c:if test="${ purMgmtSearchVO.brScn2Yn == '' }">checked=true</c:if>> 대리점</label>
                </span>
                <input type="image" src="/kr/images/common/button/btn_search03.gif" alt="SEARCH" onClick="brAgentSearch()"/>
            </div>



            <div class="boardlist-wrap subsection02">
                <div class="list-status-wrap">
                <c:if test="${paginationInfo.totalRecordCount > 0 }">
                    <p class="list-status"><b>${purMgmtSearchVO.wpaNm}${purMgmtSearchVO.brDtlAdr2}</b> 에서 총 <b>${paginationInfo.totalRecordCount}개의 지점 / 대리점</b>이 검색 되었습니다.</p>
                </c:if>
                </div>
                <table summary="번호, 지점/대리점명, 주소, 카마스터상담, 지점상담">
                <caption>카마스터 검색 결과 리스트</caption>
                <colgroup>
                    <col width="8%" />
                    <col width="20%" />
                    <col />
                    <col width="15%" />
                    <col width="15%" />
                </colgroup>
                <thead>
                <tr>
                    <th scope="col">NO</th>
                    <th scope="col">지점/대리점명</th>
                    <th scope="col">주소</th>
                    <th scope="col">카마스터상담</th>
                    <th scope="col">지점상담</th>
                </tr>
                </thead>
                
                    <tbody>
                        <c:set var="rowNum"
                               value="${ paginationInfo.totalRecordCount - (paginationInfo.currentPageNo-1)* paginationInfo.pageSize}" />
                        <c:forEach var="result" items="${resultList}" varStatus="status">
                            <tr>
                                
                                <td class="center"><c:out value="${result.rnum}"/></td>        <!-- 번호 -->
                                <td class="left"><c:out value="${result.brNm}"/></td>        <!-- 제목 -->
                                <td class="left"><c:out  value='${result.brAdr}'/></td>       <!-- 노출여부 -->
                                <td class="center">
                                    <input type="radio" class="check" id="rdCarMstSet" name= "rdCarMstSet" onClick="carMstSet('${result.brCd }') "/>
                                </td>                              
                                <td class="center">
                                    <input type="radio" class="check" id="rdCarMstSet" name="rdCarMstSet" onClick="brSet('${result.brCd}')"/>
                                </td>                              
                            </tr>
                        </c:forEach>
                    </tbody>                

                </table>
            </div>
                <!-- 페이징 -->
                 <!-- <c:if test="${paginationInfo.totalRecordCount > 0 }"> -->
                 
                        <div class="paging">
                        <able:pagination paginationInfo="${paginationInfo}" type="image" jsFunction="fnLinkPage" />
                        </div>
               
                <!-- </c:if> -->            
            
            
            <div class="btnwrap">
                <a href="javascript:void(0)" class="" id="counselReqID"><img src="/kr/images/common/button/btn_counsel_application02.gif" alt="상담신청"     onclick="reqConfirm()"/></a>
            </div>
            <div class="application-tip subsection02">
                <ul class="list-type01">
                    <li><b class="point04">지점/대리점 상담 선택시</b> : 카마스터를 지정하지 않고 지점/대리점에 바로 상담신청을 합니다.(이 경우 해당 지점/대리점에서 카마스터를 지정해 드립니다.)</li>
                    <li><b class="point04">카마스터  상담 선택시</b>  :지점/대리점의 카마스터를 직접 지정하여 상담신청을 합니다.</li>
                </ul>
            </div>
        </div>
 
<!-- //구매상담 신청 -->     

        </form>
    </div>
    <div id="zipCodePopUp"   style="display:none"></div>
    <div id="cmstCarInfo" style="display:none"></div>
    <hr />
    <%@ include file="/WEB-INF/jsp/com/include/footer.jspf" %>